#include "StdAfx.h"
#include "NOT.h"
#include <iostream>

NOT NOT::cInstance( "NOT");

NOT::NOT(const char* szID )
	: Gate( szID )
{
}

NOT::NOT(void)
{
	this->AddInput(new Input());
	Gate::LinkInputsWithGate();
}


NOT::~NOT(void)
{
}


void NOT::Calculation()
{
	if (GetInput(0)->GetValue() == 1)
		this->GetOutput()->SetValue(0);
	else
		this->GetOutput()->SetValue(1);
}

Node* NOT::clone()
{
	return new NOT();
}